//#include <stdin.h>
#include "../lib/kernel/hash.h"
#include "threads/palloc.h"
#include "threads/thread.h"
#include <stdint.h>

struct hash frame_table;

struct frame
{
  void *paddr;
  void *uaddr;
  struct hash_elem elem;
  struct thread * holder;
  int64_t time;
  tid_t tid;
};

void *
get_frame(enum palloc_flags flags);

void
free_frame(const void * paddr);

unsigned
frame_hash_func (struct hash_elem *e, void *aux);

bool
frame_less_func (struct hash_elem *a_, struct hash_elem *b_, void *aux);

struct frame * frame_lookup(void * paddr);
struct frame * get_oldest_frame(struct hash * h);


